package cc.fs.zhihuapp;

import android.content.Context;
import android.util.DisplayMetrics;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.ImageView;

/**
 * Created by fostion on 1/6/16.
 * UI辅助类
 */
public class UIHelper {

    /**
     * 帮助ImageView加载Url
     */
    public static void imageLoadUrl(ImageView imageView,String url){
    }

    /**
     * 获取屏幕长宽
     */
    public static DisplayMetrics getDisplayMetrics(Context context){
        return context.getResources().getDisplayMetrics();
    }

    /**
     * 隐藏键盘
     */
    public static void hiddenSoftKeyboard(View view){
        InputMethodManager imm = (InputMethodManager)view.getContext().getSystemService(Context.INPUT_METHOD_SERVICE);
        if(imm.isActive()){
            imm.hideSoftInputFromInputMethod(view.getWindowToken(),0);
        }

    }
}
